package ua.kpi.fpm.km61.strat.sp.st;

import java.util.HashSet;
import java.util.Set;

public class ClassName {
	
	private Set<Symbol> properties = new HashSet<Symbol>();
	private Symbol constructor = new Symbol();
	private Set<Symbol> methods = new HashSet<Symbol>();
	private Symbol name = new Symbol();
	
	/**
	 * @return the name
	 */
	public Symbol getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(Symbol name) {
		this.name = name;
	}
	
	/**
	 * @return the constructor
	 */
	public Symbol getConstructor() {
		return constructor;
	}
	
	/**
	 * @param constructor the constructor to set
	 */
	public void setConstructor(Symbol constructor) {
		this.constructor = constructor;
	}
	
	public boolean addProperty(Symbol symb){
		return this.properties.add(symb);
	}
	
	public boolean addMethod(Symbol symb){
		return this.methods.add(symb);
	}
	
	public boolean hasProperty(String str){
		for(Symbol symb: this.properties){
			if(symb.getName().equals(str)){
				return !symb.isPrivateSymbol();
			}
		}
		return false; 
	}
	
	public boolean hasMethod(String str){
		for(Symbol symb: this.methods){
			if(symb.getName().equals(str)){
				return !symb.isPrivateSymbol();
			}
		}
		return false; 
	}
	
}
